/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.shinyray.project.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;

/**
 * 项目所需电子表单。电子表单是项目所需要通过系统填写的各类单证。
 * @author Administrator
 */
@Entity
public class ProjectForm implements Serializable {
    @ManyToOne
    private Project project;
    private static final long serialVersionUID = 1L;
    //表单标题
    private String formTitle;

    //填写日期
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date createDate;

    //填表人姓名
    private String applicantName;
    //填表人帐号
    private String applicantAccount;
    //表单附件
    @OneToMany
    private List<ProjectFormAttachment> attachmentList;
    //表单内容
    @Lob
    private String formContent;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProjectForm)) {
            return false;
        }
        ProjectForm other = (ProjectForm) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.shinyray.project.entity.ProjectForm[id=" + id + "]";
    }

    public String getApplicantAccount() {
        return applicantAccount;
    }

    public void setApplicantAccount(String applicantAccount) {
        this.applicantAccount = applicantAccount;
    }

    public String getApplicantName() {
        return applicantName;
    }

    public void setApplicantName(String applicantName) {
        this.applicantName = applicantName;
    }

    public List<ProjectFormAttachment> getAttachmentList() {
        return attachmentList;
    }

    public void setAttachmentList(List<ProjectFormAttachment> attachmentList) {
        this.attachmentList = attachmentList;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getFormContent() {
        return formContent;
    }

    public void setFormContent(String formContent) {
        this.formContent = formContent;
    }

    public String getFormTitle() {
        return formTitle;
    }

    public void setFormTitle(String formTitle) {
        this.formTitle = formTitle;
    }

    public Project getProject() {
        return project;
    }

    public void setProject(Project project) {
        this.project = project;
    }

}
